#include <iostream>
#include <string>
using namespace std;

int main(){
	freopen("in.txt","r",stdin);
	string s,p = "PATest";
	cin >> s;
	cout << s;
	int mp[6] = { };
	for(int i=0; i<s.length(); i++){
		int pos = p.find(s[i]);
		if( pos!=string::npos ) mp[pos]++;
	}
	while( true ){
		int flag = 0;
		for(int i=0; i<6; i++ )
			if( mp[i]-- >0 ) {
				cout << p[i];	
				flag = 1;
			}
		if( flag == 0 ) break;
	}
	return 0;
}
